SERVO MOTOR INTERFACING WITH ARDUINO
In this project, we are going to control the position of a Servo Motor using Arduino. A Servo Motor is a type of actuator that provides high precision control of linear or angular position.
Synopsis

Movement of objects can be controlled by controlling motion of motors. similarly in robotics, servo motor control mechanism is very useful to control position of robotics. Servo motor is position controlled motor. It can easily control physical movement of objects due to its position controlled feature. Servo motor can not move continuously.  servo motors rotate in angel ranging from 0 to 180 degree.

In this project, we are going to control the position of a Servo Motor using Arduino. A Servo Motor is a type of actuator that provides high precision control of linear or angular position. A typical servo motors consists of four things (or parts): a DC Motor (or AC Motor), a gear unit, a position and speed sensing device and a control unit.

Description

A simple Servo Motor consists of a small DC motor, a potentiometer for providing position feedback, a gear system for increased torque and a control system.

Typically, simple servo motors consists of three wires. These are usually color coded as Red, Brown and Orange (may vary with different models). The Red wire is used for supply, the Brown wire is used for ground and the Orange wire is used for control signal.

Here, the control signal will determine the position of the servo motor’s shaft. The control signal is usually a PWM signal but this PWM signal is not used to control the speed of the motor as in case of a DC Motor. But rather, it is used to determine the position of the servo meter.

Here, the control signal will determine the position of the servo motor’s shaft. The control signal is usually a PWM signal but this PWM signal is not used to control the speed of the motor as in case of a DC Motor. But rather, it is used to determine the position of the servo meter.

The DC Motor in the servo motor is powered as per the control signal it receiver. As per the feedback from the position sensing system (like a potentiometer), when the servo achieves the desired position, the power to the motor is terminated.

Even though the power supply to the motor inside the servo motor is not constant, the overall power should be constant as the servo motor has a dedicated system that controls the power.

The frequency of PWM (Pulse Width Modulated) signal can vary based on type of servo motor. The important thing here is the DUTY RATIO of the PWM signal. Based on this DUTY RATION the control electronics adjust the shaft.


Proteus design for Servo Motor interfacing with Arduino


Orcad design for Servo Motor interfacing with Arduino


Servo Motor interfacing with Arduino

/* Name    : main.c
* Purpose  : Source code for Servo Motor Interfacing with Arduino.
* Author   : Gemicates
* Date     : 09-02-2018
* Website  : www.gemicates.org
* Revision : None
*/
#include<Servo.h>                                   // header file for controlling servo
Servo servo_sweep;                                  // create servo object to control a servo
int angle = 0;                                      // variable to store the servo position

void setup()
{
servo_sweep.attach(9);                              // attached the servo on pin 9 to the servo object
}

void loop()
{
  for(int angle = 0; angle <=180; angle += 1)       // goes from 0 degrees to 180 degrees in steps of 1 degree
  {
    servo_sweep.write(angle);                       // tell servo to go to position in variable 'angle'
    delay(20);                                      // waits 20ms between servo commands
  }

  for(angle = 180; angle >= 1; angle -= 1)          // goes from 180 degrees to 0 degrees
  {
    servo_sweep.write(angle);                       // move servo in opposite direction
    delay(20);                                      // waits 20ms between servo commands
  }
}

Error message here!

Show Error message here!


Forgot your password?

Error message here!

Send OTP

Error message here!

Show Error message here!


Lost your password? Please enter your email address. You will receive a password you Need.

Send Error message here!


Back to log-in

Close